package de.koller.worlders.engine.tiles.landscape;

import de.koller.oceanFramework.math.Vec;
import de.koller.oceanFramework.util.ColorIntUtil;
import de.koller.worlders.engine.entity.zone.SkyZone;
import java.awt.image.BufferedImage;

public class PlayerGeneration {
	
	private final int x, y;
	private final int size = 6;
	
	public PlayerGeneration( int x, int y ) {
		this.x = x;
		this.y = y;
	}
	
	public void generate( BufferedImage map, BufferedImage light ) {
	
		for( int sx = -size-2; sx <= size+2; sx++ )
			for( int sy = -size-2; sy <= size+2; sy++ ) {
				float dis = (float)(new Vec( sx, sy ).getLength());
				
				if( dis < size )
					map.setRGB( sx+x, sy+y, ColorIntUtil.getIntColor( SkyZone.GEN_ID, 2 ,0, 0 ) );
				
				if( dis > size+1 )
					continue;
				
//				light.setRGB( sx, sy, 0xff0000ff );
//				float l = (dis / (size+1f)) * 150f;
//				light.setRGB( sx+x, sy+y, ColorIntUtil.getIntColor( 0xff, 0, 0, 255-(int)l ) );
			}
		
		light.setRGB( x, y, 0xff0000ff );
	}
	
}
